//
//  NewsTableViewCell.m
//  RedManStock
//
//  Created by lanou3g on 15/7/29.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "NewsTableViewCell.h"
#import "MyHandle.h"
@implementation NewsTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setNews:(News *)news{
    
    if (_news != news) {
        _news = news;
    }
    
    self.simtitleLabel.text = news.simtitle;
    self.simtitleLabel.numberOfLines = 0;
    self.simdigestLabel.text = news.simdigest;
    self.simdigestLabel.numberOfLines = 0;
    self.commentnumLabel.text = news.commentnumSB;
//    自定义label高度，并更新frame
    CGFloat simtitleLabelHeight = [MyHandle stringHeight:news.simtitle fontSize:15 width:self.simtitleLabel.frame.size.width];
    self.simtitleLabel.frame = CGRectMake(self.simtitleLabel.frame.origin.x
                                          , self.simtitleLabel.frame.origin.y, self.simtitleLabel.frame.size.width, simtitleLabelHeight);
//    自定义label高度，并更新frame
    CGFloat simdigestLabelHeight = [MyHandle stringHeight:news.simdigest fontSize:13 width:self.simdigestLabel.frame.size.width];
    self.simdigestLabel.frame = CGRectMake(self.simdigestLabel.frame.origin.x
                                          , self.simdigestLabel.frame.origin.y, self.simdigestLabel.frame.size.width, simdigestLabelHeight);
    
    
    
}



@end
